<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ElectricMeterReadingLog extends Model
{
    protected $connection = 'mysql_center';
    protected $table = "electric_meter_reading_log";

    public function one_user()
    {
        return $this->hasOne(Users::class, "id", "user_id")->selectRaw("username,id");
    }

    public function name()
    {
        return $this->hasOne(ElectricElectricity::class, 'id', 'meter_id');
    }

    public function address()
    {
        return $this->hasOne(ElectricCommunity::class, 'id', 'community_id');
    }
}
